GetPendingLeaveRequestsCountQueryHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 10
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A execute 0 3 1
1
import { Inject } from '@nestjs/common';
2
import { QueryHandler } from '@nestjs/cqrs';
3
import { GetPendingLeaveRequestsCountQuery } from './GetPendingLeaveRequestsCountQuery';
4
import { ILeaveRequestRepository } from 'src/Domain/HumanResource/Leave/Repository/ILeaveRequestRepository';
5
6
@QueryHandler(GetPendingLeaveRequestsCountQuery)
7
export class GetPendingLeaveRequestsCountQueryHandler {
8
  constructor(
9
    @Inject('ILeaveRequestRepository')
10
    private readonly leaveRequestRepository: ILeaveRequestRepository
11
  ) {}
12
13
  public async execute(_: GetPendingLeaveRequestsCountQuery): Promise<number> {
14
    return await this.leaveRequestRepository.getPendingCount();
15
  }
16
}
17